﻿using Wolfpack.Core.Configuration;
using Wolfpack.Core.Interfaces.Entities;
using Wolfpack.Core.Notification.Filters.Request;
using Wolfpack.Core;

namespace Wolfpack.Contrib.Checks.MongoDb
{
    public class MongoLogsConfigurationDiscovery : HealthCheckDiscoveryBase<MongoLogsCheckConfig, MongoLogsCheck>
    {
        protected override MongoLogsCheckConfig GetConfiguration()
        {
            return new MongoLogsCheckConfig
                       {
                           Enabled = true,
                           Environment = string.Empty,
                           FriendlyId = "CHANGME!",
                           MongoLogDatabase = string.Empty,
                           MongoLogServerName = string.Empty,
                           NotificationMode = StateChangeNotificationFilter.FilterName,
                           NumberOfMinutesPreviousToCheck = 60
                       };
        }

        protected override void Configure(ConfigurationEntry entry)
        {
            entry.Name = "MongoLogHealthCheck";
            entry.Description = "This check will search the Mongo Log for any recent entries";
            entry.Tags.AddIfMissing("Mongo");
        }
    }
}